package com.yuanfeng.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanfeng.commoms.dto.PageUserTokenBeanDTO;
import com.yuanfeng.commoms.dto.order.PlatFormMemberSelfQueryDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.order.dto.*;
import com.yuanfeng.order.entity.OrderBaseEntity;
import io.seata.core.exception.TransactionException;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.Map;

/**
 * @ClassName OrderBaseService
 * @Description  订单详细信息
 * @Author cyp
 * @Date 2023-06-06 15:00:49
 * @Version 1.0
 **/
public interface OrderBaseService extends IService<OrderBaseEntity> {
    /**
     * 支付时查询商品实付金额
     * @param map
     * @return
     */
     ResponseResult queryAmountPaid(Map<String, String> map);

    /**
     * 查询用户已兑换的用户积分数量
     * @param map
     * @return
     */
    ResponseResult queryintegraOrdersCount(Map<String, Object> map);


    /**
     * 查询是否多订单
     *
     * @param map
     * @return
     */
    Integer queryShopIdByOrderIdNum(Map<String, Object> map);

    /**
     * 查询是否多订单
     *
     * @param map
     * @return
     */
    ResponseResult queryShopIdByOrderInfo(Map<String, Object> map);

    /**
     * 查询商品数量
     *
     * @param map
     * @return
     */
    Integer queryGoodNumByOrderId(Map<String, Object> map);

    /**
     * 订单消息
     *
     * @param map
     * @return
     */
    ResponseResult messageToRemind(Map<Object, Object> map);

    /**
     * 判断订单状态已辨用作删除
     *
     * @param map
     * @return
     */
    ResponseResult deleteOrder(Map<String, Object> map);

    /**
     * 取消订单
     *
     * @param map
     * @return
     */
    ResponseResult cancelTheOrder(Map<Object, Object> map) throws TransactionException;

    /**
     * 确认收货
     *
     * @param map
     * @return
     */
    ResponseResult confirmTheGoods(Map<Object, Object> map) throws TransactionException;


    /**
     * 延迟收货
     *
     * @param map
     * @return
     */
    ResponseResult delayToReceiveGoods(Map<Object, Object> map);

    /**
     * 查询已售订单信息(订单详情)
     *
     * @param map
     * @return
     */
    ResponseResult enquireSoldOrders(Map<String, Object> map);

    /**
     * 添加评论
     *
     * @param para
     * @return
     */
    ResponseResult addComments(CommentsListDTO para) throws TransactionException;

    /**
     * 首页订单总数
     *
     * @param map
     * @return
     */
    ResponseResult ordersTotal(Map<Object, Object> map);

    /**
     * 销量排名
     *
     * @param map
     * @return
     */
    ResponseResult salesNo(Map<Object, Object> map);


    /**
     * 计算销售额
     * @param map
     * @return
     */
    ResponseResult calculatedSales(Map<Object, Object> map);

    /**
     * 查询虚拟订单未评价订单
     *
     * @param map
     * @return
     */
    ResponseResult queryVirtualOrderByEvaluation(Map<String, Object> map);


    /**
     * 订单信息查询(兑换记录列表)
     *
     * @param map
     * @return
     */
    ResponseResult queryIntegralOrders(Map<String, Object> map);

    /**
     * 查询积分未评价订单
     *
     * @param map
     * @return
     */
    ResponseResult queryIntegralOrderByEvaluation(Map<String, Object> map);

    /**
     * 查询买家订单发票列表
     *
     * @param map
     * @return
     */
    ResponseResult queryOrderInvoiceList(Map<String, Object> map);

    /**
     * 真实订单之卖出交易
     *
     * @param
     * @return
     */
    ResponseResult orderSellingTransaction(SellingInputDTO sellingPara);

    /**
     * 真实订单之卖出交易 导出
     *
     * @param
     * @return
     */
    ResponseResult orderSellingTransactionExcel(SellingInputDTO sellingPara);

    /**
     * 订单之订单详情
     *
     * @param buyingPara
     * @return
     */
    ResponseResult PlatFormBackGroundByOrderDetails(Map<String, Object> buyingPara);

    /**
     * 订单之卖出交易
     *
     * @param
     * @return
     */
    ResponseResult PlatFormBackGroundBySelling(SellingInputDTO sellingPara);

    /**
     * 订单之卖出交易Exp
     *
     * @param
     * @return
     */
    ResponseResult PlatFormBackGroundBySellingExp(SellingInputDTO sellingPara);

    /**
     * 超出时间申请售后拒绝
     * @param paraMap
     * @return
     */
    ResponseResult overTimeReturnOrder(Map<String, String> paraMap) throws ParseException;

    /**
     * 查询物流信息
     *
     * @param map
     * @return
     */
    ResponseResult queryLogistics2(Map<Object, Object> map);

    /**
     * 根据orderId 获取已经上传的支付凭证信息
     * @return
     */
    ResponseResult querkVocherImages(QukVocherImagesDTO param);

    /**
     * 审核 线下订单 (上传凭证)
     * @return
     */
    ResponseResult checkPaymentVocher(QukVocherImagesDTO param);

    /**
     * 判断该订单是否是虚拟订单或者是门店自提订单
     */
    ResponseResult isVirtualOrder(Map<String, String> orderIdIsNum);

    /**
     * 为虚拟订单添加兑换码
     */
    ResponseResult addRedeemCode(Map<String, Object> param);

    /**
     * 下单通知
     */
    ResponseResult orderToInform(Map<String, Object> map);

    /**
     * 获取非数字订单
     */
    ResponseResult queryUpayByOrderId(String order_id);

    /**
     * 更新支付方式、时间等字段
     */
    ResponseResult UpdateOrderBaseByPayment(Map<String, Object> map);

    /**
     * 更新orderBase中支付方式等字段 feign 支付宝
     *
     * @param map
     * @return
     */
    boolean fiveUpdateOrderBaseByPayment(Map<Object, Object> map);

    /**
     * 订单之线下订单 导出
     *
     * @param sellingInputDTO
     * @return
     * @throws ParseException
     */
    ResponseResult PlatFormOfflineOrderEXcel(SellingInputDTO sellingInputDTO) throws ParseException;


    /**
     * 订单之卖出交易
     *
     * @param sellingPara
     * @return
     * @throws ParseException
     */
    ResponseResult PlatFormBackGroundBySellingNew(SellingInputNewDTO sellingPara) throws ParseException, IllegalAccessException;

    /**
     * 订单之卖出交易 导出
     *
     * @param sellingPara
     */
    ResponseResult platFormOnlineOrdersEXcel(SellingInputNewDTO sellingPara);


    /**
     * 根据订单id查订单信息
     *
     * @param OrderId
     * @return
     */
    ResponseResult selectOrderInfoById(String OrderId);

    /**
     * 查询卖家中心订单发票列表
     * @param param
     * @return
     */
    ResponseResult querySellerOrderInvoiceList(Map<String, Object> param);

    /**
     * 已售订单
     *
     * @param map
     * @return
     */
    ResponseResult soldOrders(Map<String, Object> map);

    /**
     *
     * @param map
     * @return
     */
    ResponseResult pseudoDelete(Map<String, Object> map);

    /**
     * 平台每日交易额(可按时间查询)
     *
     * @param map
     * @return
     */
    ResponseResult dailyTurnoverOfThePlatform(Map<String, Object> map);

    /**
     * 平台总交易额(可按时间查询)
     *
     * @param map
     * @return
     */
    ResponseResult totalTurnoverOfThePlatform(Map<String, Object> map);

    /**
     * 店铺排行
     *
     * @param map
     * @return
     */
    ResponseResult storeRanking(Map<String, Object> map);

    /**
     * 订单详情
     * @param map
     * @return
     */
    ResponseResult businessManageByOrderDetails(Map<String, Object> map);


    /*
     * 根据红包编码查询订单详情
     */
    ResponseResult getRedPacketOrder(Map<String, String> paraMap);


    /**
     * 订单之自身会员交易
     *
     * @param param
     * @return
     */
   ResponseResult queryPlatFormMemberSelfPard(PlatFormMemberSelfQueryDTO param) throws IllegalAccessException;


    /**
     * 发货
     *
     * @param map
     * @return
     */
    ResponseResult shipments(Map<Object, Object> map) throws TransactionException;


    /**
     * 平台积分商城 兑换列表 删除
     *
     * @param map
     * @return
     */
    ResponseResult deleteIntegralOrder(Map<Object, Object> map);

    /**
     * 物流消息
     * @param map
     * @return
     */
    ResponseResult logisticsInformation(Map<String, Object> map);

    /**
     * 平台查询 交易明细
     *
     * @param param
     * @return
     */
    ResponseResult queryMonthsaleReport(MonthReportDTO param);

    /**
     * 平台查询 交易明细 导出
     *
     * @param param
     * @return
     */
    ResponseResult queryMonthsaleReportExcel(MonthReportDTO param);


    /**
     * 平台财务订单 列表导出
     *
     * @param param
     * @return
     */
    ResponseResult queryRealOrderSelfPardExcel(RealOrderSelfDTO param);


    /**
     * 平台财务订单 列表查询
     *
     * @param param
     * @return
     */
   ResponseResult queryRealOrderSelfPard(RealOrderSelfDTO param) throws IllegalAccessException;

    /**
     * 修改订单信息(店铺名)
     *
     * @param map
     * @return
     */
    ResponseResult updateByMap(Map<String, Object> map);


    /**
     * 查询退保店铺详情
     *
     * @param map
     * @return
     */
    ResponseResult queryReturnBondDetail(Map<String, Object> map);

    /**
     * 判断店铺下是否有未完成订单
     *
     * @param map
     * @return
     */
    ResponseResult updateShopByOrderInfo(Map<String, Object> map);

    /**
     * 平台查询积分订单列表
     *
     * @param param
     * @return
     */
    ResponseResult queryExchangeList(Map<String, Object> param);

    /**
     * 门店订单信息查询
     * @param map
     * @return
     */
    ResponseResult queryGateOrders(Map<String, Object> map);

    /**
     * 订单信息查询
     * queryOrders
     * @param map
     * @return
     */
    ResponseResult queryOrders(Map<String, Object> map);

    /**
     * 查询未评价订单
     * @param map
     * @return
     */
    ResponseResult queryOrderByEvaluation(Map<String, Object> map);

    /**
     * 平台查询用户 购买记录
     *
     * @param map
     * @return
     */
    ResponseResult queryMemberUserOrderDetail(Map<String, Object> map);

    /**
     * 查询所有虚拟订单
     * @param map
     * @return
     */
    ResponseResult virtualOrders(Map<String, Object> map);

    /**
     * 供应商  待发货订单
     * @param soldOrderRequest
     * @return
     */
    ResponseResult shipmentsByOrder(SoldOrderRequestDTO soldOrderRequest);

    /**
     * 供应商 已售经销，已售自销订单
     * @param soldOrderRequest
     * @return
     */
    ResponseResult supplySoldOrders(SoldOrderRequestDTO soldOrderRequest);

    /**
     * 门店管理中心自提订单列表
     * @param map
     * @return
     */
    ResponseResult queryGateShopOrders(Map<String, Object> map);

    /**
     * 门店 核销订单根据 兑换码 来 查询订单信息 验证核销码
     * @param map
     * @return
     */
    ResponseResult webGateShopCancelOrder(Map<String, Object> map);

    /**
     * 核销订单
     * @param map
     * @return
     */
    ResponseResult cancelGateShopOrder(Map<String,Object> map);

    /**
     * 门店管理中心自提虚拟订单列表
     * @param map
     * @return
     */
    ResponseResult queryVirtualGateShopOrders(Map<String, Object> map);

    /**
     *  查询已售订单列表
     * @param map
     * @return
     */
    ResponseResult shopGateTakeOrder(Map<String, Object> map);

    /**
     * 根据核销码获取订单信息
     * @param map
     * @return
     */
    ResponseResult queryCancelOrderDetails(Map<String, String> map);

    /**
     * 核销兑换码
     * @param map
     * @return
     */
    ResponseResult cancelOrder(Map<String,Object> map);



    /**
     * 核销订单
     * @param map
     * @return
     */
    ResponseResult businessCancelOrder(Map<String,Object> map) throws TransactionException;

    /**
     * 经销管理--经销明细
     * @param map
     * @return
     */
    ResponseResult dealerDetailList(Map<String, String> map);

    /**
     * 编辑物流单号
     * @param map
     * @return
     */
    ResponseResult changeShipments(Map<Object, Object> map);

    /**
     * 品牌店铺查询会员订单
     * @param param
     * @return
     */
    ResponseResult queryMemberOrderDetail(Map<String, Object> param);


    /**
     * 分开发货
     *
     * @param param
     * @return
     */
    ResponseResult separateShipments(ShipmentsDTO param) throws TransactionException;


    /**
     * 更改收货人商品信息
     *
     * @param map
     * @return
     */
    ResponseResult updateAddressInformation(Map<Object, Object> map);

    /**
     * 查询收货人地址信息
     *
     * @param map
     * @return
     */
    ResponseResult queryAddressInformation(Map<Object, Object> map);

    /**
     * 批量发货
     *
     * @param file
     * @return
     * @throws TransactionException
     */
    ResponseResult importShipmentsOrderExport(MultipartFile file) throws TransactionException;


    /**
     * 批量发货模板
     *
     * @param map
     * @param response
     * @return
     */
    ResponseResult batchShipmentsOrderExport(Map<String, Object> map, HttpServletResponse response);


    /**
     * 根据店铺id获取未发货订单信息，分页
     *
     * @param param
     * @return
     */
    ResponseResult queryUnshippedOrder(RetrunQueryPrintDTO param);


    /**
     * 发货订单导出
     *
     * @param map
     * @param response
     * @return
     */
    ResponseResult shippingOrderExport(Map<String, Object> map, HttpServletResponse response);

    /**
     * 查看回收站下的订单列表的商品详情
     * @param map
     * @return
     */
    ResponseResult queryRecycleBin(Map<String, Object> map);

    /**
     * 检查是否是分开发货
     * @param map
     * @return
     */
    ResponseResult queryLogisticsMessage(Map<String,Object> map);

    /**
     * 提醒用户付款
     * @param map
     * @return
     */
    ResponseResult remindPay(Map<String,Object> map);


    /**
     * 待发货订单
     *
     * @param map
     * @return
     */
    ResponseResult shipmentsOrder(Map<String, Object> map);

    /**
     * 还原回收站订单
     *
     * @param map
     * @return
     */
    ResponseResult reduction(Map<String, Object> map);


    /**
     * 回收站界面
     *
     * @param map
     * @return
     */
    ResponseResult queryRecycleBinPageDetails(Map<String, Object> map);


    /**
     * 导出回收站界面
     *
     * @param map
     * @return
     */
    ResponseResult recycleBinExcel(Map<String, Object> map);


    /**
     * 查询用户收货信息与物流名称
     *
     * @param map
     * @return
     */
    ResponseResult queryLogisticsName(Map<Object, Object> map);

    /**
     * 修改订单商品价格
     * @param map
     * @return
     */
    ResponseResult changeShoppingPrice(Map<String,Object> map);


    /**
     * webm门店核销记录
     * @return
     */
   ResponseResult cancelShopGateRecord(PageUserTokenBeanDTO page);


    /**
     * 查询某个店铺下 购买虚拟商品的用户
     *
     * @param page
     * @return
     */
    ResponseResult queryVirtualGoodsUser(PageUserTokenBeanDTO page);

    /**
     * 根据shoid 查询已经核销的订单
     *
     * @param page
     * @return
     */
    ResponseResult cancelRecord(PageUserTokenBeanDTO page);


    /**
     * 订单信息查询(PC)
     *
     * @param map
     * @return
     */
    ResponseResult queryOrdersByPC(Map<String, Object> map);



    /**
     * @param map
     * @param request
     * @param response
     * @return打印面單
     *
     */
    ResponseResult print(Map<String, Object> map, HttpServletRequest request,
                                HttpServletResponse response) throws ServletException, IOException;



    /**
     * 已售订单导出
     *
     * @param map
     * @return
     */
    ResponseResult soldOrdersExp(Map<String, Object> map);


    /**
     * 校验单号
     */
    ResponseResult checkodd(Map<String,Object> map);


    /**
     * 定时任务fegin-确认收货超过14天默认默认好评
     * @return
     */
    ResponseResult queryNotEvaluatedOrder();
}
